package com.leapp.sk.util

import android.app.Activity
import com.example.mvp.view.CabcelSureDialog
import com.leapp.sk.R

/**
 * 审核拦截弹出框
 * @author  chaohaipeng  on 2018/8/20.
 */
class ExamineInterceptUtils {
    /**
     * dialog
     */
    private var cabcelSureDialog: CabcelSureDialog? = null
    private object mHolder {
        val instance = ExamineInterceptUtils()
    }
    companion object {
        fun getInstance(): ExamineInterceptUtils {
            return mHolder.instance
        }
    }

    fun initDialog(activity: Activity){
        cabcelSureDialog = CabcelSureDialog(activity, R.style.dialog_style)
        cabcelSureDialog?.setDialogContent(activity.resources.getString(R.string.string_exit_confrm_content))

    }

    /**
     * 弹出Dialog
     */
    fun showDialog(){
        val showing = cabcelSureDialog?.isShowing
        if (!showing!!){
            cabcelSureDialog?.show()
        }
    }

}